﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Web;
using System.Data.Entity;
using Headlight.Model;
using Headlight.Repositories.Repositories;
using Headlight.Repositories.Configuration;

namespace Headlight.Repositories
{
    public class HeadlightDbContext : DbContext
    {
        public HeadlightDbContext()
            : base(nameOrConnectionString: "Headlight") { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // Use singular table names
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            modelBuilder.Configurations.Add(new QuoteConfiguration());
            
        }

        public DbSet<Quote> Quotes { get; set; }
        public DbSet<Vehicle> Vehicles { get; set; }
        public DbSet<Policy> Policies { get; set; }
        public DbSet<Driver> Drivers { get; set; }
        public DbSet<Contact> Contacts { get; set; }
    }
}





